---
title: "Prediction"
author: "Kohei Watanabe"
date: "`r format(Sys.time(), '%Y-%m-%d')`"
output: html_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE, collapse = FALSE)
source("functions.R")
```

## Newsmap

```{r}
pred <- readRDS("data_prediction.RDS")
do.call(rbind, lapply(pred, function(x) summary(test_accuracy(x))))
```

```{r, asis=TRUE}
data_f1 <- data.frame(test_accuracy(pred[[1]])["f1"], 
                      test_accuracy(pred[[2]])["f1"], 
                      test_accuracy(pred[[3]])["f1"])
colnames(data_f1) <- names(pred)
knitr::kable(data_f1, digits = 3)
```

# Seeded LDA

```{r}
pred_slda1 <- readRDS("data_prediction_slda.RDS")
do.call(rbind, lapply(pred_slda1, function(x) summary(test_accuracy(x))))
```

```{r, asis=TRUE}
data_f1 <- data.frame(test_accuracy(pred_slda1[[1]])["f1"], 
                      test_accuracy(pred_slda1[[2]])["f1"], 
                      test_accuracy(pred_slda1[[3]])["f1"])
colnames(data_f1) <- names(pred_slda1)[1:3]
knitr::kable(data_f1, digits = 3)
```
